#!/bin/bash

status=$(redis-cli -h 192.168.140.21 -p 6380 info replication | awk -F: '/master_link_status:/ {print $2}')
if [ $status=up ];then
    echo 1
else
    echo 0
fi
